package dao.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;

import dao.ProjectsDao;
import pojo.Projects;
import pojo.UserRoleProject;

/** 
* @author WuYuan
* 
*/
public class ProjectsDaoImpl implements ProjectsDao {
	private SqlSessionTemplate sqlSessionTemplate;
	
	public SqlSessionTemplate getSqlSessionTemplate() {
		return sqlSessionTemplate;
	}

	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}

	@Override
	public List<Projects> findProjectsByUrpid(String teamid, String userid) throws Exception {
		Object [] objects =new Object[]{teamid,userid};
		return sqlSessionTemplate.selectList("findProjectsByUrpid",objects);
	}

	@Override
	public UserRoleProject findRoleidByUrpid(String projectid, String userid) throws Exception {
		// TODO Auto-generated method stub
		Object [] objects =new Object[]{projectid,userid};
		return sqlSessionTemplate.selectOne("findRoleidByUrpid",objects);
	}

	@Override
	public List<UserRoleProject> findMemberByTandU(String teamid, String userid) throws Exception {
		// TODO Auto-generated method stub
		Object [] objects =new Object[]{teamid,userid};
		return sqlSessionTemplate.selectList("findMemberByTandU",objects);
	}

	
}
